import request from '@/utils/request'

/**
 * 查询角色
 * @param pageNum 分页起始数
 * @param pageSize 分页未数
 * @returns {*}
 */
export function queryAllRole(pageNum,pageSize){
  return request({
    url: `/role/queryAllRole/${pageNum}/${pageSize}`,
    method: 'get'
  })
}

/**
 * 修改角色并将后面排序加一
 * @param role
 */
export function updateRole(role){
  return request({
    url: `/role/updateRoleByRoleId`,
    method: 'put',
    data: role
  })
}

/**
 * 删除角色根据ID
 * @param roleId
 */
export function deleteRole(roleId){
  return request({
    url: `/role/deleteRoleByRoleId`,
    method: 'delete',
    params: {roleId: roleId}
  })
}

/**
 * 新增角色
 * @param role
 * @returns {*}
 */
export function addRole(role){
  return request({
    url: `/role/addRole`,
    method: 'post',
    data: role
  })
}



